import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { PayAppTypesVO, PayAppTypesForm, PayAppTypesQuery } from './types';

/**
 * 查询应用支付类型关联列表
 * @param query
 * @returns {*}
 */

export const listPayAppTypes = (query?: PayAppTypesQuery): AxiosPromise<PayAppTypesVO[]> => {
  return request({
    url: '/system/PayGroupType/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询应用支付类型关联详细
 * @param id
 */
export const getPayAppTypes = (id: string | number): AxiosPromise<PayAppTypesVO> => {
  return request({
    url: '/system/PayGroupType/' + id,
    method: 'get'
  });
};

/**
 * 新增应用支付类型关联
 * @param data
 */
export const addPayAppTypes = (data: PayAppTypesForm) => {
  return request({
    url: '/system/PayGroupType',
    method: 'post',
    data: data
  });
};

/**
 * 修改应用支付类型关联
 * @param data
 */
export const updatePayAppTypes = (data: PayAppTypesForm) => {
  return request({
    url: '/system/PayGroupType',
    method: 'put',
    data: data
  });
};

/**
 * 删除应用支付类型关联
 * @param id
 */
export const delPayAppTypes = (id: string | number | Array<string | number>) => {
  return request({
    url: '/system/PayGroupType/' + id,
    method: 'delete'
  });
};
